package cn.tyf.service.imp;

import cn.tyf.dao.WeChatDao;
import cn.tyf.domain.WeChat;
import cn.tyf.service.WeChatService;
import cn.tyf.util.MD5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class WeChatServiceImpl implements WeChatService {

    @Autowired
    private WeChatDao weChatDao;

    @Override
    public void add(Integer uid, String opemid) {
        weChatDao.add(uid,MD5Util.digest(opemid));
    }

    @Override
    public void delete(Integer uid) {
        weChatDao.delete(uid);
    }

    @Override
    public WeChat findByOpenid(String openid) {
        return weChatDao.findByOpenid(openid);
    }

    @Override
    public WeChat findByUid(Integer uid) {
        return weChatDao.findByUid(uid);
    }

}
